# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.DriveLabels.V2.Model.GoogleAppsDriveLabelsV2FieldLimits do
  @moduledoc """
  Field constants governing the structure of a Field; such as, the maximum title length, minimum and maximum field values or length, etc.

  ## Attributes

  *   `dateLimits` (*type:* `GoogleApi.DriveLabels.V2.Model.GoogleAppsDriveLabelsV2DateLimits.t`, *default:* `nil`) - Date Field limits.
  *   `integerLimits` (*type:* `GoogleApi.DriveLabels.V2.Model.GoogleAppsDriveLabelsV2IntegerLimits.t`, *default:* `nil`) - Integer Field limits.
  *   `longTextLimits` (*type:* `GoogleApi.DriveLabels.V2.Model.GoogleAppsDriveLabelsV2LongTextLimits.t`, *default:* `nil`) - Long text Field limits.
  *   `maxDescriptionLength` (*type:* `integer()`, *default:* `nil`) - Limits for Field description, also called help text.
  *   `maxDisplayNameLength` (*type:* `integer()`, *default:* `nil`) - Limits for Field title.
  *   `maxIdLength` (*type:* `integer()`, *default:* `nil`) - Max length for the id.
  *   `selectionLimits` (*type:* `GoogleApi.DriveLabels.V2.Model.GoogleAppsDriveLabelsV2SelectionLimits.t`, *default:* `nil`) - Selection Field limits.
  *   `textLimits` (*type:* `GoogleApi.DriveLabels.V2.Model.GoogleAppsDriveLabelsV2TextLimits.t`, *default:* `nil`) - The relevant limits for the specified Field.Type. Text Field limits.
  *   `userLimits` (*type:* `GoogleApi.DriveLabels.V2.Model.GoogleAppsDriveLabelsV2UserLimits.t`, *default:* `nil`) - User Field limits.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :dateLimits =>
            GoogleApi.DriveLabels.V2.Model.GoogleAppsDriveLabelsV2DateLimits.t() | nil,
          :integerLimits =>
            GoogleApi.DriveLabels.V2.Model.GoogleAppsDriveLabelsV2IntegerLimits.t() | nil,
          :longTextLimits =>
            GoogleApi.DriveLabels.V2.Model.GoogleAppsDriveLabelsV2LongTextLimits.t() | nil,
          :maxDescriptionLength => integer() | nil,
          :maxDisplayNameLength => integer() | nil,
          :maxIdLength => integer() | nil,
          :selectionLimits =>
            GoogleApi.DriveLabels.V2.Model.GoogleAppsDriveLabelsV2SelectionLimits.t() | nil,
          :textLimits =>
            GoogleApi.DriveLabels.V2.Model.GoogleAppsDriveLabelsV2TextLimits.t() | nil,
          :userLimits =>
            GoogleApi.DriveLabels.V2.Model.GoogleAppsDriveLabelsV2UserLimits.t() | nil
        }

  field(:dateLimits, as: GoogleApi.DriveLabels.V2.Model.GoogleAppsDriveLabelsV2DateLimits)
  field(:integerLimits, as: GoogleApi.DriveLabels.V2.Model.GoogleAppsDriveLabelsV2IntegerLimits)
  field(:longTextLimits, as: GoogleApi.DriveLabels.V2.Model.GoogleAppsDriveLabelsV2LongTextLimits)
  field(:maxDescriptionLength)
  field(:maxDisplayNameLength)
  field(:maxIdLength)

  field(:selectionLimits,
    as: GoogleApi.DriveLabels.V2.Model.GoogleAppsDriveLabelsV2SelectionLimits
  )

  field(:textLimits, as: GoogleApi.DriveLabels.V2.Model.GoogleAppsDriveLabelsV2TextLimits)
  field(:userLimits, as: GoogleApi.DriveLabels.V2.Model.GoogleAppsDriveLabelsV2UserLimits)
end

defimpl Poison.Decoder, for: GoogleApi.DriveLabels.V2.Model.GoogleAppsDriveLabelsV2FieldLimits do
  def decode(value, options) do
    GoogleApi.DriveLabels.V2.Model.GoogleAppsDriveLabelsV2FieldLimits.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.DriveLabels.V2.Model.GoogleAppsDriveLabelsV2FieldLimits do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
